package business.article.entities;

import article.entities.IngredientVO;

public class Ingredient {

	private String ingr;
	private boolean inStock;
	private int id;
	
	public String getIngr() {
		return ingr;
	}
	
	public Ingredient(String ingr){
		this.ingr=ingr;		
	}
	
	public String toString(){
		return ingr;
	}

	public boolean isInStock() {
		return inStock;
	}

	public void setInStock(boolean inStock) {
		this.inStock = inStock;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Ingredient(String ingr, boolean inStock, int id) {
		this.ingr = ingr;
		this.inStock = inStock;
		this.id = id;
	}
	public Ingredient(IngredientVO ing){
		if(ing!=null){
			this.ingr = ing.getIngr();
			this.inStock = ing.isInStock();
			this.id = ing.getId();
		}
	}
	
	public IngredientVO toVO(){
		return new IngredientVO(this.ingr, this.inStock, this.id);
	}
}
